package com.hxzy.shop.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 中间表商品-砍价活动
 *
 * @TableName full_haggle_user_record
 */
@TableName(value = "full_haggle_user_record")
@Data
@ApiModel("用户砍价记录")
@Accessors(chain = true)
public class FullHaggleUserRecord implements Serializable {
    /**
     * 用户发起砍价记录ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 砍价商品id
     */
    @ApiModelProperty(value = "砍价商品id")
    @TableField(value = "drug_haggle_id")
    private Long drugHaggleId;

    /**
     * 活动id
     */
    @ApiModelProperty(value = "活动id")
    @TableField(value = "haggle_id")
    private Long haggleId;

    /**
     * 当前价格
     */
    @ApiModelProperty(value = "当前价格")
    @TableField(value = "now_price")
    private BigDecimal nowPrice;

    /**
     * 状态(0:失败/结束 1:成功 2：砍价中)
     */
    @ApiModelProperty(value = "状态(结束1：砍价中 2：砍价完成)")
    @TableField(value = "state")
    private Integer state;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 活动有效时间（用户有效时间）
     */
    @ApiModelProperty(value = "活动有效时间（结束时间）")
    @TableField(value = "valid_time")
    private Date validTime;

    /**
     * 预计帮砍人数（算法）
     */
    @ApiModelProperty(value = "预计帮砍人数（算法）")
    @TableField(value = "estimate_number")
    private Integer estimateNumber;

    /**
     * 是否优惠卷叠加购买
     */
    @ApiModelProperty(value = "是否优惠卷叠加购买")
    @TableField(value = "is_coupon")
    private Integer isCoupon;

    /**
     * 限制帮砍次数
     */
    @ApiModelProperty(value = "限制帮砍次数")
    @TableField(value = "limit_help_number")
    private Integer limitHelpNumber;

    /**
     * 已砍人数
     */
    @ApiModelProperty(value = "已砍人数")
    @TableField(value = "help_number")
    private Integer helpNumber;

    /**
     * 砍价金额规则
     */
    @ApiModelProperty(value = "砍价金额规则")
    @TableField(value = "haggle_list")
    private String haggleList;


    /**
     * 商户id
     */
    @ApiModelProperty(value = "..", hidden = true)
    @TableField(value = "merchant_id")
    private Long merchantId;
    /**
     * 用户名称
     */
    @TableField(value = "user_name")
    private String userName;


    @NotNull
    @ApiModelProperty("用户头型")
    @TableField(value = "user_head_sculpture")
    private String userHeadSculpture;


    @ApiModelProperty("是否可支付（0：否1：可以 2:支付并完成订单3：未支付取消订单）")
    @TableField(value = "is_pay")
    private Integer isPay;


    @NotNull
    @ApiModelProperty("门店id")
    @TableField(value = "store_id")
    private Long storeId;


    @ApiModelProperty("完成时间")
    @TableField(value = " completion_time")
    private Date completionTime;

    @ApiModelProperty("收货地址")
    @TableField(value = "address_id")
    private Long addressId;

    @ApiModelProperty("订单状态（0：砍价中 1：完成）")
    @TableField(value = "is_done")
    private Integer isDone;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


}